//
//  GFMoreDetialsViewController.m
//  GoodFood
//
//  Created by dllo on 15/11/5.
//  Copyright © 2015年 荣伟峰. All rights reserved.
//

#import "GFMoreDetialsViewController.h"

@interface GFMoreDetialsViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@end

@implementation GFMoreDetialsViewController

- (void)creatTableView {
    
    self.tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain];
    
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    
    [self.view addSubview:self.tableView];
    
    /* 重用池 */
    [self.tableView registerClass:[GFThreeTypeCell class] forCellReuseIdentifier:@"ThreeTypeCell"];

    
}



#pragma mark _ tableView DataSource 协议方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 23;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    GFThreeTypeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ThreeTypeCell"];
    
    cell.rowNumber = indexPath.row;
    cell.deModel = self.deModel;
    
    //    [self.tableView reloadData];
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return ScreenWidth / 375.0 * 50;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return ScreenWidth / 375.0 * 50;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

#pragma mark _ tableView Delegate 协议方法 (headview)
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenWidth / 375.0 * 50)];
    view.backgroundColor = [UIColor colorWithRed:237 / 255.0 green:237 / 255.0 blue:237 / 255.0 alpha:1];
    GFBaseLabel *label1 = [[GFBaseLabel alloc] initWithFrame:CGRectMake(ScreenWidth / 375.0 * 20, ScreenWidth / 375.0 * 20, ScreenWidth / 375.0 * 100, ScreenWidth / 375.0 * 20)];
    GFBaseLabel *label2 = [[GFBaseLabel alloc] initWithFrame:CGRectMake(ScreenWidth / 375.0 * 190, ScreenWidth / 375.0 * 20, ScreenWidth / 375.0 * 100, ScreenWidth / 375.0 * 20)];
    GFBaseLabel *label3 = [[GFBaseLabel alloc] initWithFrame:CGRectMake(ScreenWidth / 375.0 * 300, ScreenWidth / 375.0 * 20, ScreenWidth / 375.0 * 75, ScreenWidth / 375.0 * 20)];
    label1.text = @"营养元素";
    label2.text = @"每100克";
    label3.text = @"备注";
    
    [view addSubview:label1];
    [view addSubview:label2];
    [view addSubview:label3];
    return view;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    [self creatTableView];
    [self.waitView removeFromSuperview];
        // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
